<!--
	作者：leeeeyx@hotmail.com
	时间：2017-07-03
	描述：原料测算
-->
<div class="content-wrapper" style="min-height: 901px;">
	<!-- Content Header (Page header) -->
	<section class="content-header">
		<h1 style="text-align:center">
        	原料测算
      </h1>
	</section>

	<!-- Main content -->
	<section class="content">
		<div class="row">
			<div class="col-md-12">
				<div class="box">
					<div class="box-header">
						<div class="col-md-3">
							<input class="form-control" placeholder="请选择生产计划" readonly="readonly" ng-model="showProducTime" data-toggle="modal" data-target="#select"/>
						</div>
						
							<label class="col-md-9 control-label" style="height: 30px; line-height: 30px;text-align: right">餐别:<label ng-repeat="n in measures.period_time_names">{{n}}<span ng-if="!$last">,</span></label></label>
						<!--<button class="btn pull-right col-md-1" ng-click="download('tb_measures','原料测算')"><i class="fa fa-cloud-download"></i>&nbsp;&nbsp;导出</button>-->
					</div>
					<div class="box-body table-responsive no-padding">
						<table class="table table-responsive">
							
								<tr>
									<th>原料名称</th>
									<th>库存单位</th>
									<th>用料档口</th>
									<th>用料数量</th>
									<th>总量</th>
								</tr>
								<tbody ng-repeat=" i in items track by $index">
									<tr>
										<td rowspan="{{i.windows.length+1}}" style="text-align:center;vertical-align:middle;">{{i.material_name}}</td>
										<td rowspan="{{i.windows.length+1}}" style="text-align:center;vertical-align:middle;">{{i.unit}}</td>
									</tr>
									<tr ng-repeat="w in i.windows track by $index">
										<td>{{w.window_name}}</td>
										<td>{{w.count}}</td>
										<td rowspan="{{i.windows.length+1}}" ng-if="$index == '0'" style="text-align:center;vertical-align:middle;">{{i.count}}</td>
									</tr>
								</tbody>

								
						</table>
						<table class="table table-hover download" id="tb_measures">
							
								
								<tbody ng-repeat=" i in measures.items track by $index">
									<tr>
										<td rowspan="{{i.windows.length+1}}">{{i.material_name}}</td>
										<td rowspan="{{i.windows.length+1}}">{{i.unit}}</td>
									</tr>
									<tr ng-repeat="w in i.windows track by $index">
										<td>{{w.window_name}}</td>
										<td>{{w.count}}</td>
										<td rowspan="{{i.windows.length+1}}" ng-if="$index == '0'">{{i.count}}</td>
									</tr>
								</tbody>
								<tr>
									
								</tr>
								
						</table>
					</div>
					<!-- /.box-body -->
					<div class="box-footer" style="margin-bottom:10px;">

						<div class="dataTables_info col-sm-2" id="example1_info" role="status" aria-live="polite">总条目数：{{totalNums}}</div>
						<div class="col-md-6 col-md-offset-4">
							<ul class="pagination pull-right" style="margin: 0px;">
								<li class="paginate_button previous" id="example1_previous">
									<a ng-click="Previous()">上一页</a>
								</li>
								<li ng-repeat="page in pageList" ng-class="{active: isActivePage(page)}">
									<!-- class=" paginate_button active" -->
									<a ng-click="selectPage(page)">{{page}}</a>
								</li>
								<li class="paginate_button next" id="example1_next">
									<a ng-click="Next()">下一页</a>
								</li>
							</ul>
						</div>

					</div>
				</div>
				<!-- /.box -->
			</div>
		</div>
	</section>
	<!-- /.content -->
</div>
<!--
	作者：leeeeyx@hotmail.com
	时间：2017-06-29
	描述：选择生产计划
-->
<div class="modal fade" id="select" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
	<div class="modal-dialog" role="document" style="width: 50%;">
		<div class="modal-content">
			<div class="modal-header">
				
				
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<button class="btn btn-default btn-sm" style="float: right;" ng-click="download('sourceResult','用餐人')">导出</button>
				<h4 class="modal-title" id="myModalLabel">生产计划</h4>
				<div class="row">
					<div class='col-md-4'>
							<input type="text" class="form-control" id="datepicker" placeholder="请选择日期" readonly="readonly" ng-model="productPlanDate">
					</div>
					<button class="btn btn-default" ng-click="searchProductPlan()">查询</button>
				</div>
			</div>
			<div class="modal-body" style="height: 600px;overflow-y: auto;"> 
				<table class="table table-hover">
							<tbody>
								<tr>
									<td>餐别</td>
									<td>设置人</td>
									<td>设置时间</td>
									<td>选择</td>
								</tr>
								<tr ng-repeat="p in productPlans track by $index">
									<td>{{p.period_time_name}}</td>
									<td>{{p.create_by}}</td>
									<td>{{p.create_time | limitTo :10}}</td>
									<td>
				                  		<input type="checkbox" id="{{p.period_time_id}}plan" class="chk_1" name="checkplans" data-Did="{{p.period_time_id}}"/>
											<label for="{{p.period_time_id}}plan" class="checklable"></label>
				                 	 </td>
								</tr>
							</tbody>
					</table>						
			</div>
			<div class="modal-footer">
	        	<button type="button" class="btn btn-default btn-lg pull-left" data-dismiss="modal">取消</button>
	        	<button type="button" class="btn btn-primary btn-lg" ng-click="sureSelectPlan()">确定</button>
	      	</div>
		</div>
	</div>
</div>